package com.gexin.model.activity;

import com.gexin.model.GroupRuleCopy;
import com.gexin.model.activity.base.BaseMemberProductIntegralRule;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * 业务名称:  t_member_product_integral_rule() 
 */
@SuppressWarnings("serial")
public class MemberProductIntegralRule extends BaseMemberProductIntegralRule<MemberProductIntegralRule> {
	public static final MemberProductIntegralRule dao = new MemberProductIntegralRule();
	public List<MemberProductIntegralRule> getMemberProductIntegralRule(){
		List<MemberProductIntegralRule> all = dao.findAll();
		return all;
	}
	public Boolean deletMemberProductIntegralRule(String id){
		return MemberProductIntegralRule.dao.deleteById(id);
	}
	public Boolean insertMemberProductIntegralRule(Integer productId,Integer integral){
		MemberProductIntegralRule memberProductIntegralRule = new MemberProductIntegralRule();
		memberProductIntegralRule.setId(String.valueOf(UUID.randomUUID()));
		memberProductIntegralRule.setIntegral(productId);
		memberProductIntegralRule.setIntegral(integral);
		long time = new Date().getTime();
		memberProductIntegralRule.setCreateTime(time);
		memberProductIntegralRule.setUpdateTime(time);
		Boolean flag = false;
		flag = memberProductIntegralRule.save();
		return flag;
	};
}
